cmake_minimum_required(VERSION 3.22)
project(Sofa.Component.Setting LANGUAGES CXX)

set(SOFACOMPONENTUSERSETTING_SOURCE_DIR "src/sofa/component/setting")

set(HEADER_FILES
    ${SOFACOMPONENTUSERSETTING_SOURCE_DIR}/config.h.in
    ${SOFACOMPONENTUSERSETTING_SOURCE_DIR}/init.h
    ${SOFACOMPONENTUSERSETTING_SOURCE_DIR}/BackgroundSetting.h
    ${SOFACOMPONENTUSERSETTING_SOURCE_DIR}/MouseButtonSetting.h
    ${SOFACOMPONENTUSERSETTING_SOURCE_DIR}/SofaDefaultPathSetting.h
    ${SOFACOMPONENTUSERSETTING_SOURCE_DIR}/StatsSetting.h
    ${SOFACOMPONENTUSERSETTING_SOURCE_DIR}/ViewerSetting.h
)

set(SOURCE_FILES
    ${SOFACOMPONENTUSERSETTING_SOURCE_DIR}/init.cpp
    ${SOFACOMPONENTUSERSETTING_SOURCE_DIR}/BackgroundSetting.cpp
    ${SOFACOMPONENTUSERSETTING_SOURCE_DIR}/MouseButtonSetting.cpp
    ${SOFACOMPONENTUSERSETTING_SOURCE_DIR}/SofaDefaultPathSetting.cpp
    ${SOFACOMPONENTUSERSETTING_SOURCE_DIR}/StatsSetting.cpp
    ${SOFACOMPONENTUSERSETTING_SOURCE_DIR}/ViewerSetting.cpp
)

sofa_find_package(Sofa.Simulation.Core REQUIRED)

add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Simulation.Core)

sofa_create_package_with_targets(
    PACKAGE_NAME ${PROJECT_NAME}
    PACKAGE_VERSION ${Sofa_VERSION}
    TARGETS ${PROJECT_NAME} AUTO_SET_TARGET_PROPERTIES
    INCLUDE_SOURCE_DIR "src"
    INCLUDE_INSTALL_DIR "${PROJECT_NAME}"
)
